/*
* =====================================================================================
*
*       Filename:  stack.h
*
*    Description:  
*
*        Version:  1.0
*        Created:  2010年09月18日 10时55分36秒
*       Revision:  none
*       Compiler:  gcc
*
*         Author:  YOUR NAME (), 
*        Company:  
*
* =====================================================================================
*/

#ifndef STACK_INCLUDE
#define STACK_INCLUDE

#include <stddef.h>
#include <stdbool.h>
#include "except.h"
#include "mem.h"

typedef struct stack_s* stack_t;

#define T stack_t

extern except_t PopEmptyStack_Failed;



stack_t  stack_new(size_t initsize);
void     stack_push(T stack, void *element);
void *   stack_pop(T stack);
void     stack_destroy(T* stack);
extern bool     stack_isempty(T s);
void * stack_gettop(T s);



#undef T
#endif
